﻿namespace PLCS.App.UserAuthorization.Converts;

internal class MenuIsIconConvert : IValueConverter
{
    public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
    {
        const string no = "否";
        const string yes = "是";

        if (value is not string str || string.IsNullOrEmpty(str))
            return null;

        switch (str)
        {
            case "1":
                return no;

            case "0":
                return yes;

            default:
                return null;
        }
    }

    public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
    {
        return null;
    }
}